package com.omo.trigger.http;

import com.omo.api.IMachineService;
import com.omo.domain.machine.service.IMachineProductionService;
import com.omo.types.model.Response;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@CrossOrigin("*")
@RequestMapping("api/dee/machine")
public class MachineController implements IMachineService {
    @Resource
    private IMachineProductionService machineProductionService;
    @Override
    @GetMapping("/downloadMachineProduction")
    public Response<String> downloadMachineProductionExcel(String machineName) {
        machineProductionService.exportMachineProductionExcel(machineName);
        return Response.<String>builder()
                .code("200")
                .info("success")
                .data("导出成功！").build();
    }
}
